package src.main.StructuralPatterns.Adapter.Object;

public class PowerAdapter implements DC {
    private AC ac; // 组合被适配对象

    public PowerAdapter(AC ac) {
        this.ac = ac;
    }

    @Override
    public int outputDC() {
        int srcVoltage = ac.outputAC();
        return srcVoltage / 44; // 转换为5V
    }
}
